package com.batata.continuing.config.changeable;

import com.batata.continuing.service.config.ConfigSwitchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;


@Component
public class OpenOrClose {

    /**
     * 是否验证token
     */
    private boolean tokenIsVerify = true;

    public boolean getTokenIsVerify() {
        return tokenIsVerify;
    }

    @Autowired
    private ConfigSwitchService switchService;

    /**
     * 项目启动执行一次
     */
    @PostConstruct
    public void update() {
        // token是否验证
        tokenIsVerify = switchService.isVerify("1");
    }


}
